//
//  TutorialTabBarController.m
//  TutorialsModule
//
//  Created by Augusto Guido on 28/09/09.
//  Copyright 2009 Moove-IT. All rights reserved.
//

#import "TutorialTabBarController.h"

//esto va para el .h

#import "TutorialsNavigationController.h"
#import "TutorialsTableViewController.h"
#import "TutorialTabBarController.h"
#import "ConfigTableViewController.h"
#import "ConfigNavigationController.h"

@implementation TutorialTabBarController


 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
        // Custom initialization	
		
    }
    return self;
}



// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
	
	
	TutorialsNavigationController *allNavigationController = [[TutorialsNavigationController alloc] initWithNibName:nil bundle:nil];
	TutorialsNavigationController *publishedNavigationController = [[TutorialsNavigationController alloc] initWithNibName:nil bundle:nil];
	TutorialsNavigationController *pendingNavigationController = [[TutorialsNavigationController alloc] initWithNibName:nil bundle:nil];
	
	//tabs de configuracion
	ConfigNavigationController *configNavigationController = [[ConfigNavigationController alloc] initWithNibName:nil bundle:nil];
	
	//Configuro el item del tab All
	allNavigationController.tabBarItem.image = [UIImage imageNamed:@"icon_all.png"];
	allNavigationController.topViewController.title = @"All";
	
	//Configuro el item del tab Published
	publishedNavigationController.topViewController.title = @"Published";
	publishedNavigationController.tabBarItem.image = [UIImage imageNamed:@"icon_published.png"];
	
	//Configuro el item del tab Pending
	pendingNavigationController.tabBarItem.image = [UIImage imageNamed:@"icon_pending.png"];
	pendingNavigationController.topViewController.title = @"Pending";
	
	//configuro el item del tab config
	configNavigationController.tabBarItem.image = [UIImage imageNamed:@"icon_config.png"];
	configNavigationController.topViewController.title = @"Settings";
	
	
	//agrego los controller al tab bar
	self.viewControllers = [[NSArray alloc] initWithObjects:allNavigationController, publishedNavigationController, pendingNavigationController,configNavigationController, nil];
	
	//libero memoria	
	
	[allNavigationController release];
	[publishedNavigationController release];
	[pendingNavigationController release];
	[configNavigationController release];
	
}


/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
